﻿using System;

namespace LxBasic
{
    public class LxLog
    {
        private static ILog _Log = new DefaultConsole();

        public static void SetLog(ILog newlog)
        {
            _Log = newlog;
        }
        public static void Info(string message)
        {
            _Log.Info(message);
        }
        public static void Error(string message)
        {
            _Log.Error(message);
        }
        public static void Calc(string message)
        {
            _Log.Calc(message);
        }
        public static void Warn(string message)
        {
            _Log.Warn(message);
        }
        public static void Debug(string message)
        {
            _Log.Debug(message);
        }
        public interface ILog
        {
            void Calc(string message);
            void Info(string message);
            void Warn(string message);
            void Error(string message);
            void Debug(string message);
        }
        public class DefaultConsole : ILog
        {
            public void Calc(string message)
            {
                System.Diagnostics.Debug.WriteLine(message);
            }

            public void Debug(string message)
            {
                System.Diagnostics.Debug.WriteLine(message);
            }

            public void Error(string message)
            {
                System.Diagnostics.Debug.WriteLine(message);
            }
            public void Info(string message)
            {
                System.Diagnostics.Debug.WriteLine(message);
            }
            public void Warn(string message)
            {
                System.Diagnostics.Debug.WriteLine(message);
            }
        }
    }
}
